home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Brick Industry Associati…on Brick Construction 2.0
/
Brick Industry Association - Tech Notes on Brick Construction 2.0.iso
/
msie5
/
HELPCONT.CAB
/
ieshared.chm
/
shared.js
< prev
next >
Wrap
Text File
|
2000-06-06
|
42KB
|
1,060 lines
// Filename: shared.js in IEIEShared.chm
// Version post beta 3 (7)
// version 07.01.99
//************************************************ EVENT HANDLING ********************************************
//*******************************************************************************************************************
// re-directs to the proper event-driven functions.
window.onload= loadPage;
document.onclick= onclickTriage;
document.onmouseover= gettingHot;
document.onmouseout= gettingCold;
window.onunload=saveChecklistState;
window.onresize= resizeDiv;
//window.onbeforeprint= set_to_print;
//window.onafterprint= reset_form;
//******************************************** USER-DEFINED GLOBAL VARIABLES ************************************
//********************************************************************************************************************
// The images listed below can all be changed by the user.
var sPreviousTip= "Previous topic";
var sNextTip= "Next topic";
var sExpandTip= "Expand/collapse";
var sPopupTip= "View definition";
var sShortcutTip= "";
var moniker= "ms-its:"; // moniker= ""; for flat files
var sSharedCHM= moniker+"IEShared.chm::/";
var closed = sSharedCHM + "plusCold.gif"; //image used for collapsed item in callExpand()
var closedHot = sSharedCHM + "plusHot.gif"; //hot image used for collapsed item in callExpand()
var expand = sSharedCHM + "minusCold.gif"; //image used for expanded item in callExpand()
var expandHot = sSharedCHM + "minusHot.gif"; //hot image used for expanded item in callExpand()
var previousCold= sSharedCHM + "previousCold.gif";
var previousHot= sSharedCHM + "previousHot.gif";
var nextCold= sSharedCHM + "nextCold.gif";
var nextHot= sSharedCHM + "nextHot.gif";
var shortcutCold= sSharedCHM + "shortcutCold.gif";
var shortcutHot= sSharedCHM + "shortcutHot.gif";
var popupCold= sSharedCHM + "popupCold.gif";
var popupHot= sSharedCHM + "popupHot.gif";
var emptyImg= sSharedCHM + "empty.gif"; //image used for empty expand
var noteImg= sSharedCHM + "note.gif"; //image used for notes
var tipImg= sSharedCHM + "tip.gif"; //image used for tips
var warningImg= sSharedCHM + "warning.gif"; //image used for warnings
var cautionImg= sSharedCHM + "caution.gif"; //image used for cautions
var importantImg= sSharedCHM + "important.gif"; //image used for important notice
var relTopicsImg= sSharedCHM + "rel_top.gif"; //image used for important notice
var branchImg= sSharedCHM + "elle.gif";
var branchImg_RTL= sSharedCHM + "elle_rtl.gif";
//******************************************** GLOBAL VARIABLES ******************************************
//********************************************************************************************************
var printing = "FALSE";
var single = "FALSE";
var scroller = "FALSE";
var isRTL= (document.dir=="rtl");
var imgStyleRTL= "";
if (isRTL) imgStyleRTL=" style='filter:flipH' ";
var sActX_TDC= "CLASSID='CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83'"; //Tabular Data Control for reusable text data
var sSharedReusableTextFile= sSharedCHM + "shared.txt"; // common reusable text file
var sSharedReusableTextFileRecord= "para"; //reusable text record
var numbers= /\d/g; //javascript regular expression
var spaces= /\s/g; //javascript regular expression
var semicolon= /;/g; //javascript regular expression
var isIE5= (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
var isPersistent= false;
//******************************************** INITIALIZATION *************************************************
//******************************************************************************************************************
//*** loadPage **********************************************************************************************
// Adds the default image tags and re-usable text to the HTML page.
function loadPage(){
isPersistent= (document.all.item("checklist")!=null) && (isIE5);
setPreviousNext();
resizeDiv();
if (isPersistent) getChecklistState();
addReusableText();
insertImages();
}
//****** setPreviousNext ************************************************************************ *********************************************************************************************
// insert previous/next navbar
// called by: <div id="nav">@@HTMLsequenceFile.txt or .lst@@</div>
function setPreviousNext(){
var oNav = document.all.item("nav");
if (oNav == null ) return;
var sPreviousALT= sPreviousTip;
var sNextALT= sNextTip;
var sHTMLfile= oNav.innerHTML;
var imgPrev= "<IMG SRC='"+previousCold+"' BORDER=0 ALT='"+ sPreviousALT +"' ALIGN='top' "+ imgStyleRTL +">";
var imgNext= "<IMG SRC='"+nextCold+"' BORDER=0 ALT='"+ sNextALT + "' ALIGN='top' "+ imgStyleRTL +">";
var previousNextObject= "<OBJECT ID='HTMlist' WIDTH=100 HEIGHT=51 " + sActX_TDC +"><param name='DataURL' value='"
+sHTMLfile +"'><param name='UseHeader' value=True></OBJECT>";
oNav.innerHTML= "<TABLE WIDTH='100%' STYLE='margin-top:0;' cellspacing=0>"
+ "<TR><TD style='text-align=left; background-color:transparent'><A ID='previousLink' HREF='#' REL='previous' CLASS='navbar'>"
+imgPrev + "</A></TD><TD width='100%' align='center'></td><TD style='text-align=right; background-color:transparent'><A ID='nextLink' HREF='#' REL='next' CLASS='navbar'>"
+imgNext+ "</A></TD></TR></TABLE>";
document.body.innerHTML= document.body.innerHTML + previousNextObject;
findPageSeq();
if (printing == "TRUE") return;
var thisLoc= document.location.href +"#";
if (previousLink.href== thisLoc) previousLink.style.display="none";
else previousLink.style.display="block";
if (nextLink.href== thisLoc) nextLink.style.display="none";
else nextLink.style.display="block";
}
//****** findPageSeq *********************************************************************************************
// finds this page in the "html sequence list" file (filename.lst) and determines the previous & next pages from the list
// the list is created from a tool named "chumper"
function findPageSeq() {
var rs= HTMlist.recordset;
var thisLoc= document.location.href;
var iLoc= thisLoc.lastIndexOf("/");
if (iLoc > 0) thisLoc= thisLoc.substring(iLoc+1, thisLoc.length);
if (nav.style == "[object]") {
nav.style.visibility="hidden";
printing = "FALSE";
}
else
{
printing = "TRUE";
return;
}
rs.moveFirst();
while (!rs.EOF) {
if (thisLoc == rs.fields("HTMfiles").value){
nav.style.visibility="visible";
rs.MoveNext();
break;
}
previousLink.href=rs.fields("HTMfiles").value;
rs.moveNext();
}
if (!rs.EOF) nextLink.href=rs.fields("HTMfiles").value;
}
//******Re-usable text *********************************************************************************************
// Inserts the Tabular Data Control (TDC) object at the end of the page
// Inserts "re-usable text" from the txt file at: <span id="@@CHM_name@@@@index#@@" class="reuse"></span>
// e.g.<span id="printing4" class="reuse"></span> for record#4 in the printing.txt in printing.chm.
function addReusableText(){
var IESharedAdded= false; // make sure the object is only added once
var CHMspecificAdded= false; // make sure the object is only added once
var coll = document.all.tags("SPAN");
var sIndex,sRecord,sFile,sFileID,dataBindingObject;
// TDC object for IEShared.chm
var coreObject= "WIDTH=100 HEIGHT=51 "+sActX_TDC+"><param name='UseHeader' value=True><param name='FieldDelim' value='~'><param name='sort' value='INDEX'>";
var shareTextObject = "<OBJECT ID='IESharedText' " + coreObject + "<param name='DataURL' value='"+sSharedReusableTextFile+"'></OBJECT>";
for (var i=0; i< coll.length; i++)